#ifndef _KEY_H_
#define _KEY_H_

typedef enum{
	KEY_STATE_IDLE = 0,
	KEY_STATE_PRESS,
	KEY_STATE_MULTIHIT,
	KEY_STATE_UP,
}KEY_STATE_E;


typedef enum{
	KEY_ID_PRIMARY = 0,
	KEY_ID_SECONDARY,
}KEY_ID_E;


#define KEY_SHAKE_TIMES         20  //20ms

#define KEY_SCAN_TIMES          50  //50ms
#define KEY_LONG_1S_COUNT       20  //1S
#define KEY_LONG_3S_COUNT       60  //3S
#define KEY_LONG_6S_COUNT       120 //6S
#define KEY_LONG_10S_COUNT      200 //10S

#define KEY_MULTIHIT_TIMES      400 //400ms


void app_key_gpio_init(void);

void app_key_gpio_deinit(void);

uint8_t app_key_get_id(void);

void app_key_gpio_irq(void);

void app_key_timer_stop(void);

void app_key_timer_callback(void);
void app_key_multihit_timer_callback(void);

void app_key_send_event(uint8_t id, uint8_t event);

void app_key_init(void);

void app_key_deinit(void);

#endif

